package com.weiyuwqj.app.mobile.debt;

import com.weiyuwqj.api.common.Paginator;
//import com.weiyuwqj.api.hengfeng.param.HfDebtInvestParam;
import com.weiyuwqj.api.service.BusDebtInvestService;
import com.weiyuwqj.api.service.BusInvestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by zhangyong on 2017/3/22.
 * app用户债权投资记录
 */
@Controller
@RequestMapping("/mobile/user/debtInvest")
public class MobileDebtInvestController {

    @Autowired
    private BusDebtInvestService debtInvestService;
    @Autowired
    private BusInvestService investService;

//    /**
//     * 债权投资记录列表
//     * @param p                  分页参数
//     * @param debtInvestParam    债权投资记录对象
//     * @return
//     */
//    @ResponseBody
//    @RequestMapping("/getDebtInvestList")
//    public Object getDebtInvestList(Paginator p,HfDebtInvestParam debtInvestParam) {
//        return debtInvestService.getDebtInvestList(p, debtInvestParam);
//    }

    /**
     * 根据userId查询可债权的记录
     * @param p       分页参数
     * @param userId  用户id
     * @return
     */
    @ResponseBody
    @RequestMapping("/getCanDebtInvestList")
    public Object getCanDebtInvestList(Paginator p,Integer userId) {
        return debtInvestService.getSupportDebtInvest(p, userId);
    }

    /**
     * 根据userId查询所有债权和投资记录
     * @param p       分页参数
     * @param userId  用户id
     * @return 所有债权和投资记录
     */
    @ResponseBody
    @RequestMapping(value = "/getUserDebtAndInvestList",method = RequestMethod.POST)
    public Object getAllDebtInvestList(Paginator p,Integer userId) {
        return debtInvestService.getAllDebtInvestList(p, userId);
    }

    /**
     * 根据userId查询所有债权和投资记录,包记录
     * @param p       分页参数
     * @param userId  用户id
     * @return 所有债权和投资记录
     */
    @ResponseBody
    @RequestMapping(value = "/getInvestSetList",method = RequestMethod.POST)
    public Object getInvestSetList(Paginator p,Integer userId){
        return investService.getInvestSetList(p,userId);
    }
}
